import { ADD_CART_INFO, ADD_CART_INFO_COUNT, QUANXUAN_OR_QUANBUXUAN } from './mutation_type'

export default {
  [ADD_CART_INFO] (state, payload) {
    state.cartList.push(payload)
  },
  [ADD_CART_INFO_COUNT] (state, payload) {
    payload.count++
  },
  [QUANXUAN_OR_QUANBUXUAN] (state, payload) {
    state.cartList.forEach(item => {
      item.checked = payload
    })
  }
}
